package com.example.examapp;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Index extends AppCompatActivity {

    private EditText t1;
    private Button btn1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_index);

        t1=(EditText)findViewById(R.id.editName2);
        btn1=(Button)findViewById(R.id.button1);
        Intent intent=new Intent();

    }

    public void Back2Main(View view) {
        Intent intent=new Intent(Index.this,MainActivity.class);
        intent.putExtra("Name",t1.getText().toString());
        setResult(2,intent);
        finish();
    }
}